haproxy: Get rid of bashisms from get-latest-patches.sh
authorRosen Penev <[email protected]>
Thu, 25 Jul 2019 02:07:31 +0000 (19:07 -0700)
committerRosen Penev <[email protected]>
Thu, 25 Jul 2019 02:07:31 +0000 (19:07 -0700)
Plus some other shellcheck cleanups.

Signed-off-by: Rosen Penev <[email protected]>
net/haproxy/get-latest-patches.sh

index f3c59beeb73311bb46e680b891ada3cd5c53eaee..2e2402b66f5a2d0869a08bd8910cce8552d36eef 100755 (executable)
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
-CLONEURL=http://git.haproxy.org/git/haproxy-2.0.git
+CLONEURL=https://git.haproxy.org/git/haproxy-2.0.git
 BASE_TAG=v2.0.3
 TMP_REPODIR=tmprepo
 PATCHESDIR=patches
@@ -15,10 +15,10 @@ find ${PATCHESDIR} -type f -name "*.patch" -exec rm -f "{}" \;
 i=0
 for cid in $(git -C "${TMP_REPODIR}" rev-list ${BASE_TAG}..HEAD | tac); do
        filename="$(printf "%03d" $i)-$(git -C "${TMP_REPODIR}" log --format=%s -n 1 $cid | sed -e"s/[()']//g" -e's/[^_a-zA-Z0-9+-]\+/-/g' -e's/-$//').patch"
-       printf "Creating ${filename}\n"
-       git -C "${TMP_REPODIR}" show $cid > "${PATCHESDIR}/$filename"
+       printf "Creating %s\n" "${filename}"
+       git -C "${TMP_REPODIR}" show "$cid" > "${PATCHESDIR}/$filename"
        git add "${PATCHESDIR}/$filename"
-       let i++
+       i=$((i+1))
 done
 
 rm -rf "${TMP_REPODIR}"